package com.bjsasc.open.mqtt.result;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;


/** 
 * @ClassName: JsonResult 
 * @Description: 统一API响应结果封装
 * @author zhangbingbing 
 * @date 2024年3月25日 下午1:40:26 
 * @version 1.0 
 */
@Data
//非空返回
@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
public class JsonResult {
	
    private int code;

    private String message = "success";

    private Object data;

    public JsonResult setCode(ResultCode resultCode){
        this.code = resultCode.code;
        return this;
    }

    public JsonResult setMessage(String message){
        this.message = message;
        return this;
    }

    public JsonResult setData(Object data){
        this.data = data;
        return this;
    }
	
}
